<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录验证</title>
    <link rel="stylesheet" type="text/css" href="../captcha/css/verify.css">
    <script>
        (function () {
            if (!window.Promise) {
                document.writeln('<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-promise/4.1.1/es6-promise.min.js"><' + '/' + 'script>');
            }
        })();
    </script>
</head>
<body style="margin: 0;text-align: -webkit-center;">
<div id="mpanel1" >
</div>
</body>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="../captcha/js/crypto-js.js"></script>
<script src="../captcha/js/ase.js"></script>
<script src="../captcha/js/verify.js" ></script>
<script>
    // 初始化验证码  嵌入式
    $('#mpanel1').slideVerify({
        baseUrl:'/api',  //服务器请求地址;
        mode:'fixed',
        imgSize : {       //图片的大小对象
            width: '400px',
            height: '200px',
        },
        barSize:{
            width: '400px',
            height: '40px',
        },
        ready : function() {  //加载完毕的回调
        },
        success : function(params) { //成功的回调
            console.log(JSON.stringify(params));

            // 返回的二次验证参数 合并到验证通过之后的逻辑 参数中回传服务器
            var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
            parent.doLogin(params.captchaVerification);
            parent.layer.close(index);
        },
        error : function() {        //失败的回调
        }
    });
</script>
</html>